#ifndef _ADDR_BYTES_HPP
#define _ADDR_BYTES_HPP

#include <boost/shared_ptr.hpp>
#include <stdint.h>

#include "RequestCore.hpp"
#include "PrePrepare.hpp"

namespace BFT
{

  namespace messages
  {
    
    const uint32_t ALL_REPLICAS = 0xFFFFFFFF;

    class AddrBytes
    {
      boost::shared_ptr<char> buffer;
      uint32_t buffer_length;
      uint32_t index;
    public:
      AddrBytes(char * _buffer, uint32_t bl, uint32_t i) : buffer(_buffer), buffer_length(bl), index(i) {}
      AddrBytes(boost::shared_ptr<char> _buffer, uint32_t bl, uint32_t i) : buffer(_buffer), buffer_length(bl), index(i) {}
      inline boost::shared_ptr<char> getBuffer() {return buffer;}
      inline uint32_t getBL() {return buffer_length;}
      inline uint32_t getIndex() {return index;}
    };

    struct RCWrapper
    {
      boost::shared_ptr<BFT::messages::RequestCore> _rc;
    };
    struct PPWrapper
    {
      boost::shared_ptr<BFT::order::messages::PrePrepare> _pp;
    };
    struct VecWrapper
    {
      boost::shared_ptr<std::vector<boost::shared_ptr<BFT::messages::RequestCore> > > _vec;
    };
  }
}


#endif
